import { Module } from "@nestjs/common";
import { AppController } from "./app.controller";
import { AppService } from "./app.service";
import { PatientController } from "./patient/patient.controller";
import { PanelModule } from "./panel/panel.module";

import { PatientService } from "./patient/patient.service";
import { PatientModule } from "./patient/patient.module";

import { EventEmitterModule } from "@nestjs/event-emitter";
import { GlobalStatusService } from "./global/global-status/global-status.service";
import { GlobalEventsService } from "./global/global-events/global-events.service";
import { GlobalStatusModule } from "./global/global-status/global-status.module";
import { ScheduleService } from "./schedule/schedule.service";
import { ScheduleModule } from "@nestjs/schedule";
import { TransportWithinServiceModule } from "./micro/transport/transport-within-service.module";
import { configuration } from "../../../config/config";
import { PrismaModule, PrismaService } from "@app/prisma";
import { EtcdModule } from "@app/etcd";
import { NatsClientModule } from "@app/nats-client";
import { LogModule } from "@app/log";
import { EnumMicroService } from "../../../types/types";

@Module({
  imports: [
    LogModule.register(EnumMicroService.system),
    EventEmitterModule.forRoot(),
    ScheduleModule.forRoot(),
    NatsClientModule.forRoot(configuration.systemServer.nats_client_name),
    TransportWithinServiceModule,
    PanelModule,
    PatientModule,
    GlobalStatusModule,
    PrismaModule,
    EtcdModule.register(configuration.systemServer.etcd_service_name),
  ],
  controllers: [AppController, PatientController],
  providers: [
    AppService,
    PrismaService,
    PatientService,
    GlobalStatusService,
    GlobalEventsService,
    ScheduleService,
  ],
})
export class AppModule {}
